package com.aspose.cells;

class zayb extends zawf {
   private zagu a;
   private zagu b;
   private int c;
   private int[] d;
   private boolean e;
   private int f;
   private boolean g;
   private int h;
   private int i;
   private int j;
   private int k;
   private int l;
   private int m;
   private int n;

   public zayb(zagu var1, zagu var2, int var3, int[] var4, int var5, int var6, boolean var7, int var8, boolean var9) {
      this.a = var1;
      this.b = var2;
      this.c = var3;
      this.d = var4;
      this.i = var5;
      this.h = var8;
      this.g = var9;
      this.f = var6;
      this.e = var7;
      this.j = com.aspose.cells.b.a.za.a((int[])this.d, 0, this.d.length, (int)this.i);
      if (this.j < 0) {
         this.j = -this.j - 1;
      }

      this.k = com.aspose.cells.b.a.za.a(this.d, this.j, this.d.length, this.i + var6);
      if (this.k < 0) {
         this.k = -this.k - 1;
      }

      this.l = this.k - this.j;
   }

   zayb(zayb var1) {
      this.a = var1.a;
      this.b = var1.b;
      this.c = var1.c;
      this.d = var1.d;
      this.e = var1.e;
      this.f = var1.f;
      this.g = var1.g;
      this.h = var1.h;
      this.i = var1.i;
      this.j = var1.j;
      this.k = var1.k;
      this.l = var1.l;
      this.m = var1.m;
      this.n = var1.n;
   }

   public zahn b(zaay var1) {
      return new zayb(this);
   }

   public int c() {
      return this.e ? this.f : 1;
   }

   public int d() {
      return this.e ? 1 : this.f;
   }

   public int e() {
      return this.f;
   }

   public boolean l() {
      return this.f == 1;
   }

   public boolean m() {
      return !this.e;
   }

   public boolean n() {
      return this.e;
   }

   public int b() {
      return this.c;
   }

   public zagu a(int var1, int var2) {
      return com.aspose.cells.b.a.za.a(this.d, this.j, this.l, (this.e ? var1 : var2) + this.i) > -1 ? this.b : this.a;
   }

   public void f() {
      this.m = this.j - 1;
      this.n = -1;
   }

   public boolean b(int var1, int var2) {
      return this.a(this.e ? var1 : var2);
   }

   public boolean a(int var1) {
      if (var1 == this.n) {
         return true;
      } else {
         var1 += this.i;
         ++this.m;
         if (this.m < this.k) {
            if (this.d[this.m] > var1) {
               if (this.m > 0 && this.d[this.m - 1] > var1) {
                  this.m = com.aspose.cells.b.a.za.a(this.d, this.j, this.m - this.j - 1, var1);
                  if (this.m < 0) {
                     this.m = -this.m - 1;
                  }
               }

               this.n = this.d[this.m] - this.i;
               return true;
            }

            if (this.d[this.m] == var1) {
               this.n = var1 - this.i;
               return true;
            }

            ++this.m;
            if (this.m >= this.k) {
               this.n = -1;
               return false;
            }

            this.m = com.aspose.cells.b.a.za.a(this.d, this.m, this.k - this.m, var1);
         } else {
            this.m = com.aspose.cells.b.a.za.a(this.d, this.j, this.l, var1);
         }

         if (this.m < 0) {
            this.m = -this.m - 1;
            if (this.m >= this.k) {
               this.n = -1;
               return false;
            }
         }

         this.n = this.d[this.m] - this.i;
         return true;
      }
   }

   public boolean g() {
      ++this.m;
      if (this.m < this.k) {
         this.n = this.d[this.m] - this.i;
         return true;
      } else {
         this.n = -1;
         return false;
      }
   }

   public zagu h() {
      return this.b;
   }

   public int i() {
      return this.e ? this.n : 0;
   }

   public int j() {
      return this.e ? 0 : this.n;
   }

   public int k() {
      return this.n;
   }

   public zahn b(int var1) {
      return (zahn)(this.e ? new zaya(com.aspose.cells.b.a.za.a(this.d, this.j, this.j, var1 + this.i) > -1 ? this.b : this.a, this.c) : this);
   }

   public zahn c(int var1) {
      return (zahn)(this.e ? this : new zaya(com.aspose.cells.b.a.za.a(this.d, this.j, this.j, var1 + this.i) > -1 ? this.b : this.a, this.c));
   }

   public zagu o() {
      return this.f == 1 && this.l > 0 ? this.b : this.a;
   }

   public zagu p() {
      return this.f == 1 && this.l > 0 ? this.b : this.a;
   }

   public boolean x() {
      return this.g && this.e;
   }

   public boolean y() {
      return this.g && !this.e;
   }

   public void a(zaay var1) {
      if (this.g) {
         if (this.e) {
            if (var1.g == this.h) {
               return;
            }

            this.i += this.h - var1.g;
            this.h = var1.g;
         } else {
            if (var1.h == this.h) {
               return;
            }

            this.i += this.h - var1.h;
            this.h = var1.h;
         }

         this.j = com.aspose.cells.b.a.za.a((int[])this.d, 0, this.d.length, (int)this.i);
         if (this.j < 0) {
            this.j = -this.j - 1;
         }

         this.k = com.aspose.cells.b.a.za.a(this.d, this.j, this.d.length, this.i + this.f);
         if (this.k < 0) {
            this.k = -this.k - 1;
         }

         this.l = this.k - this.j;
      }
   }

   public boolean q() {
      return true;
   }

   public int r() {
      return this.l > 0 ? (this.e ? this.d[this.j] - this.i : 0) : -1;
   }

   public int s() {
      return this.l > 0 ? (this.e ? this.d[this.k - 1] - this.i : 0) : -1;
   }

   public int t() {
      return this.l > 0 ? (this.e ? 0 : this.d[this.j] - this.i) : -1;
   }

   public int u() {
      return this.l > 0 ? (this.e ? 0 : this.d[this.k - 1] - this.i) : -1;
   }

   public int v() {
      return this.l > 0 ? this.d[this.j] - this.i : -1;
   }

   public int w() {
      return this.l > 0 ? this.d[this.k - 1] - this.i : -1;
   }
}
